/**
 * 生成随机字符串
 * len: Number 字符串长度
 * */
export const randomString = function (len) {
	len = len || 32;
	/****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
	var $chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
	var maxPos = $chars.length;
	var pwd = "";
	for (let i = 0; i < len; i++) {
		pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
	}
	return pwd;
};

/**
 * 生成随机字符串作为图标id
 * name: String 图标名称
 **/
export const getIconId = function (name="icon") {
	let id = name + "-" + new Date().getTime() + "-" + randomString(32);
	return id;
}